home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60src.lha / Vim / vim60 / src / version.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-26  |  19.2 KB  |  1,071 lines

  1. /* vi:set ts=8 sts=4 sw=4:
  2.  *
  3.  * VIM - Vi IMproved        by Bram Moolenaar
  4.  *
  5.  * Do ":help uganda"  in Vim to read copying and usage conditions.
  6.  * Do ":help credits" in Vim to see a list of people who contributed.
  7.  * See README.txt for an overview of the Vim source code.
  8.  */
  9.  
  10. #include "vim.h"
  11.  
  12. /*
  13.  * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
  14.  * It has been changed beyond recognition since then.
  15.  *
  16.  * Differences between version 5.x and 6.x can be found with ":help version6".
  17.  * Differences between version 4.x and 5.x can be found with ":help version5".
  18.  * Differences between version 3.0 and 4.x can be found with ":help version4".
  19.  * All the remarks about older versions have been removed, they are not very
  20.  * interesting.
  21.  */
  22.  
  23. #include "version.h"
  24.  
  25. char    *Version = VIM_VERSION_SHORT;
  26. char    *mediumVersion = VIM_VERSION_MEDIUM;
  27.  
  28. #if defined(HAVE_DATE_TIME) || defined(PROTO)
  29. # if (defined(VMS) && defined(VAXC)) || defined(PROTO)
  30. char    longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
  31.                               + sizeof(__TIME__) + 3];
  32.     void
  33. make_version()
  34. {
  35.     /*
  36.      * Construct the long version string.  Necessary because
  37.      * VAX C can't catenate strings in the preprocessor.
  38.      */
  39.     strcpy(longVersion, VIM_VERSION_LONG_DATE);
  40.     strcat(longVersion, __DATE__);
  41.     strcat(longVersion, " ");
  42.     strcat(longVersion, __TIME__);
  43.     strcat(longVersion, ")");
  44. }
  45. # else
  46. char    *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
  47. # endif
  48. #else
  49. char    *longVersion = VIM_VERSION_LONG;
  50. #endif
  51.  
  52. static void version_msg __ARGS((char *s));
  53.  
  54. static char *(features[]) =
  55. {
  56. #ifdef AMIGA        /* only for Amiga systems */
  57. # ifdef FEAT_ARP
  58.     "+ARP",
  59. # else
  60.     "-ARP",
  61. # endif
  62. #endif
  63. #ifdef FEAT_AUTOCMD
  64.     "+autocmd",
  65. #else
  66.     "-autocmd",
  67. #endif
  68. #ifdef FEAT_BEVAL
  69.     "+balloon_eval",
  70. #else
  71.     "-balloon_eval",
  72. #endif
  73. #ifdef FEAT_BROWSE
  74.     "+browse",
  75. #else
  76.     "-browse",
  77. #endif
  78. #ifdef NO_BUILTIN_TCAPS
  79.     "-builtin_terms",
  80. #endif
  81. #ifdef SOME_BUILTIN_TCAPS
  82.     "+builtin_terms",
  83. #endif
  84. #ifdef ALL_BUILTIN_TCAPS
  85.     "++builtin_terms",
  86. #endif
  87. #ifdef FEAT_BYTEOFF
  88.     "+byte_offset",
  89. #else
  90.     "-byte_offset",
  91. #endif
  92. #ifdef FEAT_CINDENT
  93.     "+cindent",
  94. #else
  95.     "-cindent",
  96. #endif
  97. #ifdef FEAT_CLIENTSERVER
  98.     "+clientserver",
  99. #else
  100.     "-clientserver",
  101. #endif
  102. #ifdef FEAT_CLIPBOARD
  103.     "+clipboard",
  104. #else
  105.     "-clipboard",
  106. #endif
  107. #ifdef FEAT_CMDL_COMPL
  108.     "+cmdline_compl",
  109. #else
  110.     "-cmdline_compl",
  111. #endif
  112. #ifdef FEAT_CMDHIST
  113.     "+cmdline_hist",
  114. #else
  115.     "-cmdline_hist",
  116. #endif
  117. #ifdef FEAT_CMDL_INFO
  118.     "+cmdline_info",
  119. #else
  120.     "-cmdline_info",
  121. #endif
  122. #ifdef FEAT_COMMENTS
  123.     "+comments",
  124. #else
  125.     "-comments",
  126. #endif
  127. #ifdef FEAT_CRYPT
  128.     "+cryptv",
  129. #else
  130.     "-cryptv",
  131. #endif
  132. #ifdef FEAT_CSCOPE
  133.     "+cscope",
  134. #else
  135.     "-cscope",
  136. #endif
  137. #if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
  138.     "+dialog_con_gui",
  139. #else
  140. # if defined(FEAT_CON_DIALOG)
  141.     "+dialog_con",
  142. # else
  143. #  if defined(FEAT_GUI_DIALOG)
  144.     "+dialog_gui",
  145. #  else
  146.     "-dialog",
  147. #  endif
  148. # endif
  149. #endif
  150. #ifdef FEAT_DIFF
  151.     "+diff",
  152. #else
  153.     "-diff",
  154. #endif
  155. #ifdef FEAT_DIGRAPHS
  156.     "+digraphs",
  157. #else
  158.     "-digraphs",
  159. #endif
  160. #ifdef EBCDIC
  161.     "+ebcdic",
  162. #else
  163.     "-ebcdic",
  164. #endif
  165. #ifdef FEAT_EMACS_TAGS
  166.     "+emacs_tags",
  167. #else
  168.     "-emacs_tags",
  169. #endif
  170. #ifdef FEAT_EVAL
  171.     "+eval",
  172. #else
  173.     "-eval",
  174. #endif
  175. #ifdef FEAT_EX_EXTRA
  176.     "+ex_extra",
  177. #else
  178.     "-ex_extra",
  179. #endif
  180. #ifdef FEAT_SEARCH_EXTRA
  181.     "+extra_search",
  182. #else
  183.     "-extra_search",
  184. #endif
  185. #ifdef FEAT_FKMAP
  186.     "+farsi",
  187. #else
  188.     "-farsi",
  189. #endif
  190. #ifdef FEAT_SEARCHPATH
  191.     "+file_in_path",
  192. #else
  193.     "-file_in_path",
  194. #endif
  195. #ifdef FEAT_FIND_ID
  196.     "+find_in_path",
  197. #else
  198.     "-find_in_path",
  199. #endif
  200. #ifdef FEAT_FOLDING
  201.     "+folding",
  202. #else
  203.     "-folding",
  204. #endif
  205. #ifdef FEAT_FOOTER
  206.     "+footer",
  207. #else
  208.     "-footer",
  209. #endif
  210.         /* only interesting on Unix systems */
  211. #if !defined(USE_SYSTEM) && defined(UNIX)
  212.     "+fork()",
  213. #endif
  214. #ifdef FEAT_GETTEXT
  215. # ifdef DYNAMIC_GETTEXT
  216.     "+gettext/dyn",
  217. # else
  218.     "+gettext",
  219. # endif
  220. #else
  221.     "-gettext",
  222. #endif
  223. #ifdef FEAT_HANGULIN
  224.     "+hangul_input",
  225. #else
  226.     "-hangul_input",
  227. #endif
  228. #if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
  229. # ifdef DYNAMIC_ICONV
  230.     "+iconv/dyn",
  231. # else
  232.     "+iconv",
  233. # endif
  234. #else
  235.     "-iconv",
  236. #endif
  237. #ifdef FEAT_INS_EXPAND
  238.     "+insert_expand",
  239. #else
  240.     "-insert_expand",
  241. #endif
  242. #ifdef FEAT_JUMPLIST
  243.     "+jumplist",
  244. #else
  245.     "-jumplist",
  246. #endif
  247. #ifdef FEAT_KEYMAP
  248.     "+keymap",
  249. #else
  250.     "-keymap",
  251. #endif
  252. #ifdef FEAT_LANGMAP
  253.     "+langmap",
  254. #else
  255.     "-langmap",
  256. #endif
  257. #ifdef FEAT_LIBCALL
  258.     "+libcall",
  259. #else
  260.     "-libcall",
  261. #endif
  262. #ifdef FEAT_LINEBREAK
  263.     "+linebreak",
  264. #else
  265.     "-linebreak",
  266. #endif
  267. #ifdef FEAT_LISP
  268.     "+lispindent",
  269. #else
  270.     "-lispindent",
  271. #endif
  272. #ifdef FEAT_LISTCMDS
  273.     "+listcmds",
  274. #else
  275.     "-listcmds",
  276. #endif
  277. #ifdef FEAT_LOCALMAP
  278.     "+localmap",
  279. #else
  280.     "-localmap",
  281. #endif
  282. #ifdef FEAT_MENU
  283.     "+menu",
  284. #else
  285.     "-menu",
  286. #endif
  287. #ifdef FEAT_SESSION
  288.     "+mksession",
  289. #else
  290.     "-mksession",
  291. #endif
  292. #ifdef FEAT_MODIFY_FNAME
  293.     "+modify_fname",
  294. #else
  295.     "-modify_fname",
  296. #endif
  297. #ifdef FEAT_MOUSE
  298.     "+mouse",
  299. #  ifdef FEAT_MOUSESHAPE
  300.     "+mouseshape",
  301. #  else
  302.     "-mouseshape",
  303. #  endif
  304. # else
  305.     "-mouse",
  306. #endif
  307. #if defined(UNIX) || defined(VMS)
  308. # ifdef FEAT_MOUSE_DEC
  309.     "+mouse_dec",
  310. # else
  311.     "-mouse_dec",
  312. # endif
  313. # ifdef FEAT_MOUSE_GPM
  314.     "+mouse_gpm",
  315. # else
  316.     "-mouse_gpm",
  317. # endif
  318. # ifdef FEAT_MOUSE_JSB
  319.     "+mouse_jsbterm",
  320. # else
  321.     "-mouse_jsbterm",
  322. # endif
  323. # ifdef FEAT_MOUSE_NET
  324.     "+mouse_netterm",
  325. # else
  326.     "-mouse_netterm",
  327. # endif
  328. # ifdef FEAT_MOUSE_XTERM
  329.     "+mouse_xterm",
  330. # else
  331.     "-mouse_xterm",
  332. # endif
  333. #endif
  334. #ifdef __QNX__
  335. # ifdef FEAT_MOUSE_PTERM
  336.     "+mouse_pterm",
  337. # else
  338.     "-mouse_pterm",
  339. # endif
  340. #endif
  341. #ifdef FEAT_MBYTE_IME
  342. # ifdef DYNAMIC_IME
  343.     "+multi_byte_ime/dyn",
  344. # else
  345.     "+multi_byte_ime",
  346. # endif
  347. #else
  348. # ifdef FEAT_MBYTE
  349.     "+multi_byte",
  350. # else
  351.     "-multi_byte",
  352. # endif
  353. #endif
  354. #ifdef FEAT_MULTI_LANG
  355.     "+multi_lang",
  356. #else
  357.     "-multi_lang",
  358. #endif
  359. #ifdef FEAT_GUI_W32
  360. # ifdef FEAT_OLE
  361.     "+ole",
  362. # else
  363.     "-ole",
  364. # endif
  365. #endif
  366. #ifdef FEAT_OSFILETYPE
  367.     "+osfiletype",
  368. #else
  369.     "-osfiletype",
  370. #endif
  371. #ifdef FEAT_PATH_EXTRA
  372.     "+path_extra",
  373. #else
  374.     "-path_extra",
  375. #endif
  376. #ifdef FEAT_PERL
  377. # ifdef DYNAMIC_PERL
  378.     "+perl/dyn",
  379. # else
  380.     "+perl",
  381. # endif
  382. #else
  383.     "-perl",
  384. #endif
  385. #ifdef FEAT_PRINTER
  386. # ifdef FEAT_POSTSCRIPT
  387.     "+postscript",
  388. # else
  389.     "-postscript",
  390. # endif
  391.     "+printer",
  392. #else
  393.     "-printer",
  394. #endif
  395. #ifdef FEAT_PYTHON
  396. # ifdef DYNAMIC_PYTHON
  397.     "+python/dyn",
  398. # else
  399.     "+python",
  400. # endif
  401. #else
  402.     "-python",
  403. #endif
  404. #ifdef FEAT_QUICKFIX
  405.     "+quickfix",
  406. #else
  407.     "-quickfix",
  408. #endif
  409. #ifdef FEAT_RIGHTLEFT
  410.     "+rightleft",
  411. #else
  412.     "-rightleft",
  413. #endif
  414. #ifdef FEAT_RUBY
  415. # ifdef DYNAMIC_RUBY
  416.     "+ruby/dyn",
  417. # else
  418.     "+ruby",
  419. # endif
  420. #else
  421.     "-ruby",
  422. #endif
  423. #ifdef FEAT_SCROLLBIND
  424.     "+scrollbind",
  425. #else
  426.     "-scrollbind",
  427. #endif
  428. #ifdef FEAT_SIGNS
  429.     "+signs",
  430. #else
  431.     "-signs",
  432. #endif
  433. #ifdef FEAT_SMARTINDENT
  434.     "+smartindent",
  435. #else
  436.     "-smartindent",
  437. #endif
  438. #ifdef FEAT_SNIFF
  439.     "+sniff",
  440. #else
  441.     "-sniff",
  442. #endif
  443. #ifdef FEAT_STL_OPT
  444.     "+statusline",
  445. #else
  446.     "-statusline",
  447. #endif
  448. #ifdef FEAT_SUN_WORKSHOP
  449.     "+sun_workshop",
  450. #else
  451.     "-sun_workshop",
  452. #endif
  453. #ifdef FEAT_SYN_HL
  454.     "+syntax",
  455. #else
  456.     "-syntax",
  457. #endif
  458.         /* only interesting on Unix systems */
  459. #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
  460.     "+system()",
  461. #endif
  462. #ifdef FEAT_TAG_BINS
  463.     "+tag_binary",
  464. #else
  465.     "-tag_binary",
  466. #endif
  467. #ifdef FEAT_TAG_OLDSTATIC
  468.     "+tag_old_static",
  469. #else
  470.     "-tag_old_static",
  471. #endif
  472. #ifdef FEAT_TAG_ANYWHITE
  473.     "+tag_any_white",
  474. #else
  475.     "-tag_any_white",
  476. #endif
  477. #ifdef FEAT_TCL
  478. # ifdef DYNAMIC_TCL
  479.     "+tcl/dyn",
  480. # else
  481.     "+tcl",
  482. # endif
  483. #else
  484.     "-tcl",
  485. #endif
  486. #if defined(UNIX) || defined(__EMX__)
  487. /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
  488. # ifdef TERMINFO
  489.     "+terminfo",
  490. # else
  491.     "-terminfo",
  492. # endif
  493. #else            /* unix always includes termcap support */
  494. # ifdef HAVE_TGETENT
  495.     "+tgetent",
  496. # else
  497.     "-tgetent",
  498. # endif
  499. #endif
  500. #ifdef FEAT_TERMRESPONSE
  501.     "+termresponse",
  502. #else
  503.     "-termresponse",
  504. #endif
  505. #ifdef FEAT_TEXTOBJ
  506.     "+textobjects",
  507. #else
  508.     "-textobjects",
  509. #endif
  510. #ifdef FEAT_TITLE
  511.     "+title",
  512. #else
  513.     "-title",
  514. #endif
  515. #ifdef FEAT_TOOLBAR
  516.     "+toolbar",
  517. #else
  518.     "-toolbar",
  519. #endif
  520. #ifdef FEAT_USR_CMDS
  521.     "+user_commands",
  522. #else
  523.     "-user_commands",
  524. #endif
  525. #ifdef FEAT_VERTSPLIT
  526.     "+vertsplit",
  527. #else
  528.     "-vertsplit",
  529. #endif
  530. #ifdef FEAT_VIRTUALEDIT
  531.     "+virtualedit",
  532. #else
  533.     "-virtualedit",
  534. #endif
  535. #ifdef FEAT_VISUAL
  536.     "+visual",
  537. # ifdef FEAT_VISUALEXTRA
  538.     "+visualextra",
  539. # else
  540.     "-visualextra",
  541. # endif
  542. #else
  543.     "-visual",
  544. #endif
  545. #ifdef FEAT_VIMINFO
  546.     "+viminfo",
  547. #else
  548.     "-viminfo",
  549. #endif
  550. #ifdef FEAT_VREPLACE
  551.     "+vreplace",
  552. #else
  553.     "-vreplace",
  554. #endif
  555. #ifdef FEAT_WILDIGN
  556.     "+wildignore",
  557. #else
  558.     "-wildignore",
  559. #endif
  560. #ifdef FEAT_WILDMENU
  561.     "+wildmenu",
  562. #else
  563.     "-wildmenu",
  564. #endif
  565. #ifdef FEAT_WINDOWS
  566.     "+windows",
  567. #else
  568.     "-windows",
  569. #endif
  570. #ifdef FEAT_WRITEBACKUP
  571.     "+writebackup",
  572. #else
  573.     "-writebackup",
  574. #endif
  575. #if defined(UNIX) || defined(VMS)
  576. # ifdef FEAT_X11
  577.     "+X11",
  578. # else
  579.     "-X11",
  580. # endif
  581. #endif
  582. #ifdef FEAT_XFONTSET
  583.     "+xfontset",
  584. #else
  585.     "-xfontset",
  586. #endif
  587. #ifdef FEAT_XIM
  588.     "+xim",
  589. #else
  590.     "-xim",
  591. #endif
  592. #if defined(UNIX) || defined(VMS)
  593. # ifdef FEAT_XCLIPBOARD
  594.     "+xterm_clipboard",
  595. # else
  596.     "-xterm_clipboard",
  597. # endif
  598. #endif
  599. #ifdef FEAT_XTERM_SAVE
  600.     "+xterm_save",
  601. #else
  602.     "-xterm_save",
  603. #endif
  604.     NULL
  605. };
  606.  
  607. static int included_patches[] =
  608. {   /* Add new patch number below this line */
  609. /**/
  610.     0
  611. };
  612.  
  613.     int
  614. highest_patch()
  615. {
  616.     int        i;
  617.     int        h = 0;
  618.  
  619.     for (i = 0; included_patches[i] != 0; ++i)
  620.     if (included_patches[i] > h)
  621.         h = included_patches[i];
  622.     return h;
  623. }
  624.  
  625.     void
  626. ex_version(eap)
  627.     exarg_T    *eap;
  628. {
  629.     /*
  630.      * Ignore a ":version 9.99" command.
  631.      */
  632.     if (*eap->arg == NUL)
  633.     {
  634.     msg_putchar('\n');
  635.     list_version();
  636.     }
  637. }
  638.  
  639.     void
  640. list_version()
  641. {
  642.     int        i;
  643.     int        first;
  644.     char    *s = "";
  645.  
  646.     /*
  647.      * When adding features here, don't forget to update the list of
  648.      * internal variables in eval.c!
  649.      */
  650.     MSG(longVersion);
  651. #ifdef WIN3264
  652. # ifdef FEAT_GUI_W32
  653. #  if defined(_MSC_VER) && (_MSC_VER <= 1010)
  654.     /* Only MS VC 4.1 and earlier can do Win32s */
  655.     MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version"));
  656. #  else
  657.     MSG_PUTS(_("\nMS-Windows 32 bit GUI version"));
  658. #  endif
  659.     if (gui_is_win32s())
  660.     MSG_PUTS(_(" in Win32s mode"));
  661. # ifdef FEAT_OLE
  662.     MSG_PUTS(_(" with OLE support"));
  663. # endif
  664. # else
  665.     MSG_PUTS(_("\nMS-Windows 32 bit console version"));
  666. # endif
  667. #endif
  668. #ifdef WIN16
  669.     MSG_PUTS(_("\nMS-Windows 16 bit version"));
  670. #endif
  671. #ifdef MSDOS
  672. # ifdef DJGPP
  673.     MSG_PUTS(_("\n32 bit MS-DOS version"));
  674. # else
  675.     MSG_PUTS(_("\n16 bit MS-DOS version"));
  676. # endif
  677. #endif
  678. #ifdef MACOS
  679. # ifdef MACOS_X
  680. #  ifdef MACOS_X_UNIX
  681.     MSG_PUTS(_("\nMacOS X (unix) version"));
  682. #  else
  683.     MSG_PUTS(_("\nMacOS X version"));
  684. #  endif
  685. #else
  686.     MSG_PUTS(_("\nMacOS version"));
  687. # endif
  688. #endif
  689.  
  690. #ifdef RISCOS
  691.     MSG_PUTS(_("\nRISC OS version"));
  692. #endif
  693. #ifdef VMS
  694.     MSG_PUTS("\nOpenVMS version");
  695. #endif
  696.  
  697.     /* Print the list of patch numbers if there is at least one. */
  698.     /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
  699.     if (included_patches[0] != 0)
  700.     {
  701.     MSG_PUTS(_("\nIncluded patches: "));
  702.     first = -1;
  703.     /* find last one */
  704.     for (i = 0; included_patches[i] != 0; ++i)
  705.         ;
  706.     while (--i >= 0)
  707.     {
  708.         if (first < 0)
  709.         first = included_patches[i];
  710.         if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
  711.         {
  712.         MSG_PUTS(s);
  713.         s = ", ";
  714.         msg_outnum((long)first);
  715.         if (first != included_patches[i])
  716.         {
  717.             MSG_PUTS("-");
  718.             msg_outnum((long)included_patches[i]);
  719.         }
  720.         first = -1;
  721.         }
  722.     }
  723.     }
  724.  
  725. #ifdef HAVE_PATHDEF
  726.     if (*compiled_user != NUL || *compiled_sys != NUL)
  727.     {
  728.     MSG_PUTS(_("\nCompiled "));
  729.     if (*compiled_user != NUL)
  730.     {
  731.         MSG_PUTS(_("by "));
  732.         MSG_PUTS(compiled_user);
  733.     }
  734.     if (*compiled_sys != NUL)
  735.     {
  736.         MSG_PUTS("@");
  737.         MSG_PUTS(compiled_sys);
  738.     }
  739.     }
  740. #endif
  741.  
  742. #ifdef FEAT_HUGE
  743.     MSG_PUTS(_("\nHuge version "));
  744. #else
  745. # ifdef FEAT_BIG
  746.     MSG_PUTS(_("\nBig version "));
  747. # else
  748. #  ifdef FEAT_NORMAL
  749.     MSG_PUTS(_("\nNormal version "));
  750. #  else
  751. #   ifdef FEAT_SMALL
  752.     MSG_PUTS(_("\nSmall version "));
  753. #   else
  754.     MSG_PUTS(_("\nTiny version "));
  755. #   endif
  756. #  endif
  757. # endif
  758. #endif
  759. #ifndef FEAT_GUI
  760.     MSG_PUTS(_("without GUI."));
  761. #else
  762. # ifdef FEAT_GUI_GTK
  763. #  ifdef FEAT_GUI_GNOME
  764.     MSG_PUTS(_("with GTK-GNOME GUI."));
  765. #  else
  766.     MSG_PUTS(_("with GTK GUI."));
  767. #  endif
  768. # else
  769. #  ifdef FEAT_GUI_MOTIF
  770.     MSG_PUTS(_("with X11-Motif GUI."));
  771. #  else
  772. #   ifdef FEAT_GUI_ATHENA
  773.     MSG_PUTS(_("with X11-Athena GUI."));
  774. #   else
  775. #    ifdef FEAT_GUI_BEOS
  776.     MSG_PUTS(_("with BeOS GUI."));
  777. #    else
  778. #     ifdef FEAT_GUI_PHOTON
  779.     MSG_PUTS(_("with Photon GUI."));
  780. #     else
  781. #      if defined(MSWIN)
  782.     MSG_PUTS(_("with GUI."));
  783. #      else
  784. #    if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
  785.     MSG_PUTS(_("with Carbon GUI."));
  786. #    else
  787. #     if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
  788.     MSG_PUTS(_("with Cocoa GUI."));
  789. #     else
  790. #      if defined (MACOS)
  791.     MSG_PUTS(_("with (classic) GUI."));
  792. #      endif
  793. #     endif
  794. #    endif
  795. #      endif
  796. #     endif
  797. #    endif
  798. #   endif
  799. #  endif
  800. # endif
  801. #endif
  802.     MSG_PUTS(_("  Features included (+) or not (-):\n"));
  803.  
  804.     /* print all the features */
  805.     for (i = 0; features[i] != NULL; ++i)
  806.     {
  807.     version_msg(features[i]);
  808.     if (msg_col > 0)
  809.         msg_putchar(' ');
  810.     }
  811.  
  812.     msg_putchar('\n');
  813. #ifdef SYS_VIMRC_FILE
  814.     version_msg(_("   system vimrc file: \""));
  815.     version_msg(SYS_VIMRC_FILE);
  816.     version_msg(_("\"\n"));
  817. #endif
  818. #ifdef USR_VIMRC_FILE
  819.     version_msg(_("     user vimrc file: \""));
  820.     version_msg(USR_VIMRC_FILE);
  821.     version_msg(_("\"\n"));
  822. #endif
  823. #ifdef USR_VIMRC_FILE2
  824.     version_msg(_(" 2nd user vimrc file: \""));
  825.     version_msg(USR_VIMRC_FILE2);
  826.     version_msg(_("\"\n"));
  827. #endif
  828. #ifdef USR_VIMRC_FILE3
  829.     version_msg(_(" 3rd user vimrc file: \""));
  830.     version_msg(USR_VIMRC_FILE3);
  831.     version_msg(_("\"\n"));
  832. #endif
  833. #ifdef USR_EXRC_FILE
  834.     version_msg(_("      user exrc file: \""));
  835.     version_msg(USR_EXRC_FILE);
  836.     version_msg(_("\"\n"));
  837. #endif
  838. #ifdef USR_EXRC_FILE2
  839.     version_msg(_("  2nd user exrc file: \""));
  840.     version_msg(USR_EXRC_FILE2);
  841.     version_msg(_("\"\n"));
  842. #endif
  843. #ifdef FEAT_GUI
  844. # ifdef SYS_GVIMRC_FILE
  845.     version_msg(_("  system gvimrc file: \""));
  846.     version_msg(SYS_GVIMRC_FILE);
  847.     MSG_PUTS(_("\"\n"));
  848. # endif
  849.     version_msg(_("    user gvimrc file: \""));
  850.     version_msg(USR_GVIMRC_FILE);
  851.     version_msg(_("\"\n"));
  852. # ifdef USR_GVIMRC_FILE2
  853.     version_msg(_("2nd user gvimrc file: \""));
  854.     version_msg(USR_GVIMRC_FILE2);
  855.     version_msg(_("\"\n"));
  856. # endif
  857. # ifdef USR_GVIMRC_FILE3
  858.     version_msg(_("3rd user gvimrc file: \""));
  859.     version_msg(USR_GVIMRC_FILE3);
  860.     version_msg(_("\"\n"));
  861. # endif
  862. #endif
  863. #ifdef FEAT_GUI
  864. # ifdef SYS_MENU_FILE
  865.     version_msg(_("    system menu file: \""));
  866.     version_msg(SYS_MENU_FILE);
  867.     MSG_PUTS(_("\"\n"));
  868. # endif
  869. #endif
  870. #ifdef HAVE_PATHDEF
  871.     if (*default_vim_dir != NUL)
  872.     {
  873.     version_msg(_("  fall-back for $VIM: \""));
  874.     version_msg((char *)default_vim_dir);
  875.     MSG_PUTS(_("\"\n"));
  876.     }
  877.     if (*default_vimruntime_dir != NUL)
  878.     {
  879.     version_msg(_(" f-b for $VIMRUNTIME: \""));
  880.     version_msg((char *)default_vimruntime_dir);
  881.     MSG_PUTS(_("\"\n"));
  882.     }
  883.     version_msg(_("Compilation: "));
  884.     version_msg((char *)all_cflags);
  885.     msg_putchar('\n');
  886. #ifdef VMS
  887.     if (*compiler_version != NUL)
  888.     {
  889.     version_msg(_("Compiler: "));
  890.     version_msg((char *)compiler_version);
  891.     msg_putchar('\n');
  892.     }
  893. #endif
  894.     version_msg(_("Linking: "));
  895.     version_msg((char *)all_lflags);
  896. #endif
  897. #ifdef DEBUG
  898.     msg_putchar('\n');
  899.     version_msg(_("  DEBUG BUILD"));
  900. #endif
  901. }
  902.  
  903. /*
  904.  * Output a string for the version message.  If it's going to wrap, output a
  905.  * newline, unless the message is too long to fit on the screen anyway.
  906.  */
  907.     static void
  908. version_msg(s)
  909.     char    *s;
  910. {
  911.     int        len = (int)STRLEN(s);
  912.  
  913.     if (len < (int)Columns && msg_col + len >= (int)Columns)
  914.     msg_putchar('\n');
  915.     MSG_PUTS(s);
  916. }
  917.  
  918. static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
  919.  
  920. /*
  921.  * Give an introductory message about Vim.
  922.  * Only used when starting Vim on an empty file, without a file name.
  923.  * Or with the ":intro" command (for Sven :-).
  924.  */
  925.     void
  926. intro_message(colon)
  927.     int        colon;        /* TRUE for ":intro" */
  928. {
  929.     int        i;
  930.     int        row;
  931.     int        blanklines;
  932.     static char    *(lines[]) =
  933.     {
  934.     N_("VIM - Vi IMproved"),
  935.     "",
  936.     N_("version "),
  937.     N_("by Bram Moolenaar et al."),
  938.     N_("Vim is open source and freely distributable"),
  939.     "",
  940.     N_("Help poor children in Uganda!"),
  941.     N_("type  :help iccf<Enter>       for information "),
  942.     "",
  943.     N_("type  :q<Enter>               to exit         "),
  944.     N_("type  :help<Enter>  or  <F1>  for on-line help"),
  945.     N_("type  :help version6<Enter>   for version info"),
  946.     NULL,
  947.     "",
  948.     N_("Running in Vi compatible mode"),
  949.     N_("type  :set nocp<Enter>        for Vim defaults"),
  950.     N_("type  :help cp-default<Enter> for info on this"),
  951.     };
  952.  
  953.     /* blanklines = screen height - # message lines */
  954.     blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
  955.     if (!p_cp)
  956.     blanklines += 4;  /* add 4 for not showing "Vi compatible" message */
  957. #if defined(WIN3264) && !defined(FEAT_GUI_W32)
  958.     if (mch_windows95())
  959.     blanklines -= 3;  /* subtract 3 for showing "Windows 95" message */
  960. #endif
  961.  
  962. #ifdef FEAT_WINDOWS
  963.     /* Don't overwrite a statusline.  Depends on 'cmdheight'. */
  964.     if (p_ls > 1)
  965.     blanklines -= Rows - topframe->fr_height;
  966. #endif
  967.     if (blanklines < 0)
  968.     blanklines = 0;
  969.  
  970.     /* start displaying the message lines after half of the blank lines */
  971.     row = blanklines / 2;
  972.     if ((row >= 2 && Columns >= 50) || colon)
  973.     {
  974.     for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
  975.     {
  976.         if (lines[i] == NULL)
  977.         {
  978.         if (!p_cp)
  979.             break;
  980.         continue;
  981.         }
  982.         if (*lines[i] != NUL)
  983.         do_intro_line(row, (char_u *)_(lines[i]), i == 2, 0);
  984.         ++row;
  985.     }
  986. #if defined(WIN3264) && !defined(FEAT_GUI_W32)
  987.     if (mch_windows95())
  988.     {
  989.         do_intro_line(++row,
  990.             (char_u *)_("WARNING: Windows 95/98/ME detected"),
  991.                             FALSE, hl_attr(HLF_E));
  992.         do_intro_line(++row,
  993.         (char_u *)_("type  :help windows95<Enter>  for info on this"),
  994.                                     FALSE, 0);
  995.     }
  996. #endif
  997.     }
  998.  
  999.     /* Make the wait-return message appear just below the text. */
  1000.     if (colon)
  1001.     msg_row = row;
  1002. }
  1003.  
  1004.     static void
  1005. do_intro_line(row, mesg, add_version, attr)
  1006.     int        row;
  1007.     char_u    *mesg;
  1008.     int        add_version;
  1009.     int        attr;
  1010. {
  1011.     char_u    vers[20];
  1012.     int        col;
  1013.     char_u    *p;
  1014.     int        l;
  1015.     char_u    buf[100];
  1016.  
  1017.     /* Center the message horizontally. */
  1018.     col = vim_strsize(mesg);
  1019.     if (add_version)
  1020.     {
  1021.     STRCPY(vers, mediumVersion);
  1022.     if (highest_patch())
  1023.     {
  1024.         /* Check for 9.9x or 9.9xx, alpha/beta version */
  1025.         if (isalpha((int)mediumVersion[3]))
  1026.         {
  1027.         if (isalpha((int)mediumVersion[4]))
  1028.             sprintf((char *)vers + 5, ".%d%s", highest_patch(),
  1029.                                mediumVersion + 5);
  1030.         else
  1031.             sprintf((char *)vers + 4, ".%d%s", highest_patch(),
  1032.                                mediumVersion + 4);
  1033.         }
  1034.         else
  1035.         sprintf((char *)vers + 3, ".%d", highest_patch());
  1036.     }
  1037.     col += (int)STRLEN(vers);
  1038.     }
  1039.     col = (Columns - col) / 2;
  1040.     if (col < 0)
  1041.     col = 0;
  1042.  
  1043.     /* Split up in parts to highlight <> items differently. */
  1044.     for (p = mesg; *p != NUL; p += l)
  1045.     {
  1046.     buf[0] = *p;
  1047.     for (l = 1; p[l] != NUL && p[l] != '<' && p[l - 1] != '>'; ++l)
  1048.         buf[l] = p[l];
  1049.     buf[l] = NUL;
  1050.     screen_puts(buf, row, col, *buf == '<' ? hl_attr(HLF_8) : attr);
  1051.     col += vim_strsize(buf);
  1052.     }
  1053.  
  1054.     /* Add the version number to the version line. */
  1055.     if (add_version)
  1056.     screen_puts(vers, row, col, 0);
  1057. }
  1058.  
  1059. /*
  1060.  * ":intro": clear screen, display intro screen and wait for return.
  1061.  */
  1062. /*ARGSUSED*/
  1063.     void
  1064. ex_intro(eap)
  1065.     exarg_T    *eap;
  1066. {
  1067.     screenclear();
  1068.     intro_message(TRUE);
  1069.     wait_return(TRUE);
  1070. }
  1071.